/* 全局样式 */
body {
    font-family: '黑体', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #333;
    background-color: #f4f4f4; /* 页面背景颜色 */
}

/* 容器 */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow-y: auto; /* 允许垂直滚动 */
    padding: 20px;
    box-sizing: border-box;
}

/* 背景插画 */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* 确保背景在最底层 */
}

.background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 角色图片 */
.character {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2; /* 确保角色在背景之上 */
}

.character img {
    width: 200px; /* 根据实际图片大小调整 */
    height: auto;
}

/* 状态栏 */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-size: 14px;
    z-index: 3; /* 确保状态栏在最上层 */
}

/* 标题 */
.header {
    margin-top: 60px; /* 与状态栏的间距 */
    text-align: center;
}

.header h1 {
    font-size: 32px;
    font-weight: bold;
    color: #007AFF;
}

/* 统计信息 */
.dashboard-content {
    display: flex;
    justify-content: space-around;
    margin: 20px auto;
    width: 80%;
    max-width: 800px;
}

.metric {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    flex: 1;
    margin: 0 10px;
}

.metric h2 {
    font-size: 20px;
    font-weight: 500;
    color: #007AFF;
}

.metric p {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

/* 图表容器 */
.chart-container {
    margin: 20px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 800px;
}

.chart-container h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #007AFF;
    text-align: center;
}

/* 图表尺寸 */
#trafficChart,
#userActivityChart {
    width: 100%;
    height: 300px;
}

/* 核心文字 */
.core-text {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 3; /* 确保核心文字在最上层 */
}

#randomText {
    font-weight: bold;
    font-size: 20px;
    color: #333;
}

#randomTranslation {
    font-style: italic;
    margin-top: 10px;
    font-size: 16px;
    color: #666;
}

/* 功能按钮 */
.switch-button {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 3; /* 确保功能按钮在最上层 */
}

.switch-button button {
    padding: 10px 20px;
    background-color: #007AFF;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.switch-button button:hover {
    background-color: #0056b3;
}

/* 下翻符号 */
.arrow-down {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 64px;
    color: #FFFFFF;
    cursor: pointer;
    z-index: 3; /* 确保下翻符号在最上层 */
}

/* 下一部分内容 */
.next-section {
    padding: 50px;
    background-color: #f4f4f4;
    text-align: center;
    z-index: 3; /* 确保下一部分内容在最上层 */
}

/* 花瓣容器 */
.petal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 防止花瓣干扰点击事件 */
    z-index: 1000; /* 确保在最上层 */
}

/* 花瓣 */
.petal {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: fall linear infinite;
}

/* 花瓣下落动画 */
@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

/* 全局样式 */
body {
    font-family: 'SF Pro Display', Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4;
}

.container {
    max-width: 400px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.container h1 {
    text-align: center;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0078d7;
}

.form-group input:invalid {
    border-color: red;
}

.form-group button {
    width: 100%;
    padding: 10px;
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-group button:hover {
    background-color: #005a9e;
}

.form-group small {
    color: #666;
}

.form-group.error {
    color: red;
    font-size: 0.8em;
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.footer a {
    color: #0078d7;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.login-container, .register-container {
    display: none;
}

.login-container.active, .register-container.active {
    display: block;
}

/* 搜索框容器 */
.search-container {
    display: flex;
    align-items: center;
    width: 300px;
    margin: 20px auto;
    position: relative;
}

/* 搜索输入框 */
.search-box {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #007AFF;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box:focus {
    border-color: #0056b3;
}

/* 搜索按钮 */
.search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button svg {
    width: 20px;
    height: 20px;
    fill: #007AFF;
    transition: fill 0.3s ease;
}

.search-button:hover svg {
    fill: #0056b3;
}

/* 登录和注册表单容器 */
.login-container, .register-container {
    display: none;
    width: 300px; /* 缩小宽度 */
    margin: 20px auto; /* 居中显示 */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: fixed; /* 固定位置 */
    top: 50%; /* 居中 */
    left: 50%; /* 居中 */
    transform: translate(-50%, -50%); /* 居中 */
}

/* 激活状态的表单显示 */
.login-container.active, .register-container.active {
    display: block;
}

/* 表单标题 */
.login-container h2, .register-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

/* 表单组 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #0078d7;
}

.form-group input:invalid {
    border-color: red;
}

.form-group button {
    width: 100%;
    padding: 10px;
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-group button:hover {
    background-color: #005a9e;
}

.form-group small {
    color: #666;
}

.form-group.error {
    color: red;
    font-size: 0.8em;
}

/* 切换链接 */
.login-container p, .register-container p {
    text-align: center;
    margin-top: 10px;
    color: #0078d7;
    cursor: pointer;
}

.login-container p:hover, .register-container p:hover {
    text-decoration: underline;
}

/* 登录和注册表单容器 */
.login-container, .register-container {
    display: none; /* 默认隐藏 */
    width: 300px; /* 缩小宽度 */
    margin: 20px auto; /* 居中显示 */
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: fixed; /* 固定位置 */
    top: 50%; /* 居中 */
    left: 50%; /* 居中 */
    transform: translate(-50%, -50%); /* 居中 */
}

/* 激活状态的表单显示 */
.login-container.active, .register-container.active {
    display: block;
}